package com.lsu.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lsu.app.bean.Schedule;
import com.lsu.app.service.ScheduleService;
import com.lsu.app.mapper.ScheduleMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @description 针对表【schedule(课程表)】的数据库操作Service实现
 * @Date 2023-11-07 18:42:41
 * @author hjj
 */
@Service
public class ScheduleServiceImpl extends ServiceImpl<ScheduleMapper, Schedule> implements ScheduleService{
    private final ScheduleMapper mapper;

    public ScheduleServiceImpl(ScheduleMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public Integer getIdByUserId(Integer userId) {
        return mapper.getIdByUserId(userId);
    }

    @Override
    public Boolean existNameOfSch(Integer userId, String name) {
        return mapper.existSchWithName(userId,name)>1;
    }

}




